package cn.wolfcode.luowowo.common.query;

import lombok.Getter;
import lombok.Setter;

@Getter@Setter
public class TravelQueryObject extends QueryObject {
    //是否公开静态常量
    public static final Integer PUBLIC_TRUE = 1;
    public static final Integer PUBLIC_FALSE = 0;
    public static final Integer PUBLIC_ALL = -1;

    private Integer state = -1; //游记状态
    private Long destId = -1L; //目的地id

    private  Integer isPublic = PUBLIC_ALL; //是否公开

    private Integer orderType = 1; //排序规则
    private Integer travelTimeType = -1; //出行时间
    private Integer perExpendType = -1; //人均消费
    private Integer dayType = -1; //旅游天数
    private Long uid;

    public TravelCondition getTravelTime(){

        return TravelCondition.TRAVEL_TIME.get(travelTimeType);
    }
    public TravelCondition getPerExpend(){

        return TravelCondition.TRAVEL_PER_EXPEND.get(perExpendType);
    }
    public TravelCondition getDays()
    {
        return TravelCondition.TRAVEL_DAYS.get(dayType);
    }
    //排序方法
    public String getOrderBy()
    {
        return orderType.equals(1) ? "releaseTime desc" : "thumbsupnum desc";
    }

}
